/**
 * 
 */
package net.betou.trade.entity.main.base;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map.Entry;

import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.entity.main.SuggestionType;

/**
 * 意见 "table: trade_suggestion"
 * @author O.Y.
 *
 */
public abstract class BaseSuggestion implements Serializable{

	private static final long serialVersionUID = 4649845002526111041L;
	
	private static final LinkedHashMap<Integer, String> statusType = new LinkedHashMap<Integer, String>();
	
	static{
		statusType.put(1, "已完成");
		statusType.put(2, "未完成");
		statusType.put(3, "已接受");
		statusType.put(4, "在处理");
		statusType.put(5, "待反馈");
	}

	private Integer id;//id
	private String title;//标题
	private String content;//内容
	private String email;//联系邮箱
	private String mobile;//手机
	private String filePath1;//附件1
	private String filePath2;//附件2
	private String filePath3;//附件3
	private Date addDate;//添加时间
	private String addIp;//提交时的ip
	private int status;//状态 1已完成 2未完成 3已接受 4在处理 5待反馈',
	
	private AgentAndAdmins admin;
	private SuggestionType type;
	
	
	public BaseSuggestion() {
		super();
	}

	public BaseSuggestion(Integer id) {
		super();
		this.id = id;
	}

	public BaseSuggestion(Integer id, String title, String content, String email, String mobile, String filePath1, String filePath2, String filePath3, Date addDate, String addIp, int status, AgentAndAdmins admin, SuggestionType type) {
		super();
		this.id = id;
		this.title = title;
		this.content = content;
		this.email = email;
		this.mobile = mobile;
		this.filePath1 = filePath1;
		this.filePath2 = filePath2;
		this.filePath3 = filePath3;
		this.addDate = addDate;
		this.addIp = addIp;
		this.status = status;
		this.admin = admin;
		this.type = type;
	}

	@Override
	public int hashCode() {
		final int PRIME = 31;
		int result = 1;
		result = PRIME * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final BaseSuggestion other = (BaseSuggestion) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	public static final Collection<Entry<Integer, String>> getStatusColl(){
		return statusType.entrySet();
	}
	
	public String getStatusName(){
		String n = statusType.get(status);
		if(n==null){
			n = "";
		}
		return n;
	}
	
	public Date getAddDate() {
		return addDate;
	}
	public void setAddDate(Date addDate) {
		this.addDate = addDate;
	}
	public String getAddIp() {
		return addIp;
	}
	public void setAddIp(String addIp) {
		this.addIp = addIp;
	}
	public AgentAndAdmins getAdmin() {
		return admin;
	}
	public void setAdmin(AgentAndAdmins admin) {
		this.admin = admin;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getFilePath1() {
		return filePath1;
	}
	public void setFilePath1(String filePath1) {
		this.filePath1 = filePath1;
	}
	public String getFilePath2() {
		return filePath2;
	}
	public void setFilePath2(String filePath2) {
		this.filePath2 = filePath2;
	}
	public String getFilePath3() {
		return filePath3;
	}
	public void setFilePath3(String filePath3) {
		this.filePath3 = filePath3;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public SuggestionType getType() {
		return type;
	}
	public void setType(SuggestionType type) {
		this.type = type;
	}
}
